package com.lxp.userms.service.impl;

import com.lxp.userms.entity.ExpertLecture;
import com.lxp.userms.mapper.ExpertLectureMapper;
import com.lxp.userms.service.ExpertLectureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ExpertLectureServiceImpl implements ExpertLectureService {

    @Autowired
    private ExpertLectureMapper lectureMapper;

    @Override
    @Transactional
    public int publishLecture(ExpertLecture lecture) {
        return lectureMapper.insertLecture(lecture);
    }

    @Override
    public List<ExpertLecture> getAllLectures() {
        return lectureMapper.selectAllLectures();
    }

    @Override
    public List<ExpertLecture> getLecturesByExpertId(int expertId) {
        return lectureMapper.selectLecturesByExpertId(expertId);
    }

    @Override
    public int deleteLecture(int id) {
        return lectureMapper.deleteLecture(id);
    }
}